<?php
include("../includes/common.php");
if($conf['is_reg']==0)sysmsg('未开放商户申请');
?>
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $conf['web_name']?>-找回密码</title>
<meta name="keywords" content="<?php echo $conf['web_name']?>,彩虹易支付,,<?php echo $conf['web_name']?>,云支付,免签约支付接口" />
    <meta name="description" content="<?php echo $conf['web_name']?> 酷享云支付" />
    <link href="/user/login/css/backend.min.css?v=442212212" rel="stylesheet">
    <link rel="stylesheet" href="/user/login/css/bootstrap.min.css">
    <link rel="stylesheet" href="/user/login/css/icons.css">
    <link rel="stylesheet" href="/user/login/css/main.css">
    <link rel="stylesheet" href="/user/login/css/responsive.css">
    <link rel="stylesheet" href="/user/login/fontspay/iconfont.css">
    <style type="text/css">
      .container a {
          color: white!important;
        }
        .container p{
          color: white!important;
        }
        .msg-box {
            display: none!important;
        }
    </style>
</head>
<body>
<div class="account-user-sec" style="background-image: url(/user/login/images/2f5bb2f5ef0e64eaf82a59f271dd0018.jpg);">
 <div class="account-sec">
          <div class="account-top-bar"  style="color:white">
               <div class="container">
                     <div class="logo">
                       <a href="javascript:void(0)" title="" ><i class="fa fa-bullseye" style="color: white"></i> <?php echo $conf['web_name']?></a>
                   </div>
                   <ul class="account-header-link">
                     <li><a title="" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $conf['web_qq']?>&site=qq&menu=yes"><b>客服QQ：<?php echo $conf['web_qq']?></b></a></li>
                    <li><a href="./login.php"><b>登陆</b></a></li>
                    <li><a href="/"><b>首页</b></a></li>
                   </ul>
               </div>
          </div>
          <div class="acount-sec">
               <div class="container">
                    <div class="row">
                         <div class="col-md-12">
                              <div class="contact-sec">
                                   <div class="row">
                                        <div class="col-md-8">   
                                             <div class="widget-title">
                                                  <h3>会员找回 </h3>
                                             </div>
                                             <div class="account-form">
                                              <form name="form" id="login-form" method="POST" action="">                       
                                                       <div class="row">
                                                           
                                                            <div class="col-md-6 feild">
                                                                 <input type="text" name="email" autocomplete="off" id="email" data-rule="required;email" placeholder="邮箱">
                                                            </div>
                                                            <div class="col-md-6 feild">
                                                                <div class="row">
                                                                  <div class="col-md-7 col-xs-7 col-sm-7 feild" style="padding-right: 0px;">
                                                                    <input type="text" name="code" id="code" placeholder="邮箱验证码" required>
                                                                    </div>
                                                                    <div class="col-md-5 col-xs-5 col-sm-5" style="padding-left: 0px;">    
                                                               <input type="button" id="sendcode"  class="btn btn-info btn-lg btn-block btn-captcha" style="border-radius: 0px;" value="获取验证码" onclick="codeButton()" required>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                         <div class="col-md-6 feild">
                                                                <input type="password" id="pwd" autocomplete="off" name="pwd" data-rule="required;pwd" placeholder="密码 密码必须6-30个字符">
                                                            </div>
                                                
                                                            <div class="col-md-6 feild">
                                                                <div class="row">
                                                                    <div class="col-md-7 col-xs-7 col-sm-7 feild" style="padding-right: 0px;">
                                                                        <input type="text" name="captcha" placeholder="验证码" data-rule="required;length(4)" style="border-radius: 0;" autocomplete="off" />
                                                                    </div>
                                                                <div class="col-md-5 col-xs-5 col-sm-5 feild" style="padding-left: 0px;">
                                                                <img src="./code.php?r=<?php echo time()?>"  style="height: 45px; width: 100%;" onclick="this.src='./code.php?r='+Math.random();">
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <?php if ( is_mobile() ) { ?>
                                                         <div class="feild col-md-12">
                                                         <button type="button" id="submit" ng-click="login()" style="width: 100%;margin-top: 13px;background: #3c3c3c none repeat ">确定找回</button>
                                                            </div>
                                                        </div>
                                                  </form>
                                             </div>
                                        </div>
                                    <div class="col-md-4">
                                <div class="creat-an-account" style="margin-top: 10px;">
                                 <span style="text-align: center;">OR</span>

                  <a href="./login.php" style="background: #10b5e8 none repeat ;width: 50%;text-align: center;margin-top: 10px;"><i class="fa fa-user"></i> 点击登陆</a>

                 <?php if ($conf['quicklogin']==1) {
                    echo '<a href="oauth.php" style="width: 50%; height:46px; text-align: center;margin-top: 10px;"><i class="iconfont" style="background: #10b5e8 none repeat;">&#xe60a;</i>支付宝登陆</a>';
                }elseif ($conf['quicklogin']==2) {
                  echo '<a href="connect.php" style="width: 50%;text-align: center;margin-top: 10px;"><i class="fa fa-qq" style="background: #4e8deb;"></i>QQ登陆</a>';
                }else{
                 echo '<a href="oauth.php" style="width: 50%; height:46px; text-align: center;margin-top: 10px;"><i class="iconfont" style="background: #10b5e8 none repeat;">&#xe60a;</i>支付宝登陆</a>';
                }
                  ?>
             </div>
                 </div>
                       </div>
                              </div>
                         </div>
                    </div>
               </div>
          </div>
          <footer style="margin-top: 10px;padding-left: 0px;">
              <div class="container">
                  <p><?php echo $conf['ban']?><i class="fa fa-heart"></i></p>
              </div>
          </footer>
     </div>
</div>
  <?PHP }else{  ?>                             
                 
      <div class="feild col-md-12">
        <button type="button" id="submit" style="width: 100%;margin-top: 13px;background: #3c3c3c none repeat ">确认找回</button>
                                 </div>
                                      </div>
                                          </form>
                                             </div>

                                             <div class="more-option">
                                                  <span>OR</span>
                                             </div>
                                        </div>
                                    <div class="col-md-4">
                                <div class="creat-an-account" style="">
                                <span>已有账号？</span>

              <a href="./login.php" style="background: #10b5e8 none repeat ;"><i class="fa fa-user" style=""></i> 点击登陆</a>
              <h4>更多方式</h4>
            <ul>

           <?php if ($conf['quicklogin']==1) {
                    echo '<li><a href="oauth.php" title=""><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span></a></li>';
                }elseif ($conf['quicklogin']==2) {
                  echo '<li><a href="connect.php" title=""><i class="fa fa-qq" style="background: #4e8deb;"></i></a></li>';
                }else{
                  echo '<li><a href="oauth.php" title=""><span class="iconfont" style="background: #4e8deb;">&#xe60a;</span></a></li>';
                }
             ?>
          </ul>
             </div>
                                        </div>
                                   </div>
                              </div>
                         </div>
                    </div>
               </div>
          </div>
          <footer style="margin-top: 10px;padding-left: 0px;">
              <div class="container">
                  <p><?php echo $conf['ban']?><i class="fa fa-heart"></i></p>
              </div>
          </footer>
     </div>
</div>
<?PHP } ?>
<script src="https://template.down.swap.wang/ui/angulr_2.0.1/bower_components/jquery/dist/jquery.min.js"></script>
<script src="https://template.down.swap.wang/ui/angulr_2.0.1/bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="../assets/layer/layer.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script> 
<script type="text/javascript">
  function codeButton(){
    var code = $("#sendcode");
    if ($(this).attr("data-lock") === "true") return;
    var email=$("input[name='email']").val();
    if(email==''){layer.msg('邮箱不能为空！');return false;}
    var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
    if(!reg.test(email)){layer.msg('邮箱格式不正确！');return false;}
     code.attr("disabled","disabled");
      setTimeout(function(){
        code.css("opacity","0.8");
      },1000)
    var ii = layer.load(2, {shade:[0.1,'#fff']});
    $.ajax({
      type : "POST",
      url : "ajax.php?act=sendemail",
      data : {email:email},
      dataType : 'json',
      success : function(data) {
        layer.close(ii);
        if(data.code == 0){
      var time = 60;
      var set=setInterval(function(){
      code.val("("+--time+")秒后获取");
      }, 1000);
      setTimeout(function(){
      code.attr("disabled",false).val("获取验证码");
      clearInterval(set);
      }, 60000);
      layer.msg('发送成功，请注意查收！');
        }else{
      var time = 60;
      var set=setInterval(function(){
      code.val("("+--time+")秒后获取");
      }, 1000);
      setTimeout(function(){
      code.attr("disabled",false).val("获取验证码");
      clearInterval(set);
      }, 60000);
          layer.alert(data.msg);
        }
      } 
    });   
  }
</script>
<script>
	$("#submit").click(function(){
		if ($(this).attr("data-lock") === "true") return;
		    var email=$("input[name='email']").val();
        var pwd=$("input[name='pwd']").val();
        var code=$("input[name='code']").val();
        var captcha=$("input[name='captcha']").val();
		    if(email==''){layer.msg('邮箱不能为空！');return false;}
        if(code==''){layer.msg('邮箱验证码不能为空！');return false;}
        if(pwd==''){layer.msg('新密码不能为空！');return false;}
        if(captcha==''){layer.msg('图形验证码不能为空！');return false;}
		   var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
		   if(!reg.test(email)){layer.msg('邮箱格式不正确！');return false;}
		   var ii = layer.load(2, {shade:[0.1,'#fff']});
		   $.ajax({
			type : "POST",
			url : "ajax.php?act=find",
			data : {email:email,pwd:pwd,code:code,captcha:captcha},
			dataType : 'json',
			success : function(data) {
				layer.close(ii);
				if(data.code == 0){
					layer.msg(data.msg);
				}else{
        layer.alert(data.msg);    
         }
			} 
		});
	});
</script>
</body>
</html>